home *** CD-ROM | disk | FTP | other *** search
- Path: hermes.is.co.za!news
- From: Itsik Rubin <yr@isis.co.za>
- Newsgroups: comp.lang.c++
- Subject: Correctnes of BORLAND C++ RTTI Info in a multi threaded environment (WindowsNT)
- Date: Wed, 20 Mar 1996 18:23:25 +0200
- Organization: No organisation supplied
- Message-ID: <315030FD.5898@isis.co.za>
- NNTP-Posting-Host: yr.isis.co.za
- Mime-Version: 1.0
- Content-Type: multipart/mixed; boundary="------------1055B205B2"
- X-Mailer: Mozilla 2.0GoldB1 (WinNT; I)
-
- This is a multi-part message in MIME format.
-
- --------------1055B205B2
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
-
- Please see the attached file.
-
- Regrads
- Itsik
- yr@isis.co.za
-
- --------------1055B205B2
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- Content-Disposition: inline; filename="mail.htm"
-
- Hello, I am using Borland C++ Version 4.51 under Windows NT I am developping
- a 32 bit application that is intended for Windows NT and I use extensively
- multi threading as wellas the streaming mechanism provided in the Borland
- class library. This is used for inter thread , inter process and inter
- processor (over a LAN) communication. The developped system is required to
- run continuously 24 hours a day 7 days a week. Approximatly once a day I run
- into a problem where during the operation of the system a stream becomes
- corrupted. When I make the following change to the opstream::WriteData
- method inside objstrm.cpp I get logs in both places (marked 1 and 2). Based
- on my observation the first _TYPENAME(strmr) is erronous whereas the second
- one returns correct results. This points to problems within the RTTI
- mechanism. The following questions (at least) need answer: 1. Is typeinfo
- object, which is part of the Borland C++ RTTI, multi-thread safe? 2. Has
- anyone else encounted this problem? 3. Is there a fix for this problem? The
- modified method in objstrm.cpp: void opstream::writeData( const
- TStreamableBase *t, ModuleId mid ) { if( good() ) { registerObject(
- CONST_CAST(TStreamableBase *,t) ); const ObjectBuilder *res = types->Lookup(
- mid, _TYPENAME(t) ); CHECKX(res,_TYPENAME(t)); TStreamer *strmr =
- res->Builder(CONST_CAST(TStreamableBase *,t)); /**/ if ( t ) /**/ { /**/
- char check [100] ; /**/ char strmtname [100] ; /**/ strcpy ( strmtname,
- _TYPENAME(strmr) ); /**/ sprintf ( check , "%s::Streamer" , _TYPENAME(t) ) ;
- /**/ if ( strcmp ( check , strmtname ) != 0 ) /**/ { /**/ char temp [200] ;
- /**/ sprintf ( temp , "WriteData lookup error %s not equal to %s" , check ,
- strmtname ) ; /* (1) */ cout << temp << endl; /**/ if ( strcmp ( strmtname,
- _TYPENAME(strmr) ) != 0 ) /**/ { /**/ sprintf ( temp, "WriteData changed
- typeinfo %s to %s", strmtname, _TYPENAME(strmr) ) ; /* (2) */ cout << temp
- << endl; /**/ } /**/ } /**/ } writeWord32( strmr->ClassVersion() );
- strmr->Write( *this ); delete strmr; } } Your quick response will be greatly
- appreciated. Regards,
-
- --------------1055B205B2--
-
-